<html>
<head>
<title>Example Unit Test</title>
<script src="unit.js"></script>
<body>
<h1><script>document.write(document.title);</script></h1>
<script>

function Sample()
{
	this.x = 1;
}

Sample.prototype.Double = function()
{
	this.x *= 2;
}

ts = new UT.TestSuite();
ts.DWOutputDiv();

ts.AddTest("All Pass", function(ut)
{
	var s = new Sample();
	ut.Assert(s.x == 1, "Constructor");
	s.Double();
	ut.Assert(s.x == 2, "Double Test 1");
	s.x = 10;
	s.Double();
	ut.Assert(s.x == 20, "Double Test 2");
	ut.AssertEval("1+1==2");
	ut.AssertGT(2, 1);
	ut.AssertGT("Z", "A");
});

ts.AddTest("All Fail", function(ut)
{
	ut.Assert(false);
	ut.AssertEval("1+1 == 3");
	ut.AssertEq(1, 2);
	ut.AssertNEq("hello", "hello");
	ut.AssertGT(1, 2);
	ut.AssertGT(undefined, 2);
	ut.AssertGT("A", "Z");
	var x = 7;
	ut.AssertFn(function () { return x != 7; });
	ut.AssertFn(new Function);
	ut.AssertFn(function () { });
	IllegalFunction();
});

ts.Run();
ts.Report();

</script>
</body>
</html>